from django.http import HttpResponse
from django.urls import reverse


def index(request):
    return HttpResponse('首页')


def articles_list(request, categories):
    if isinstance(categories, list):
        # /article/list/python+django+flask/
        print(reverse('article:list', kwargs={'categories': categories}))
    text = '图书类别：%s' % categories
    return HttpResponse(text)


def article_detail(request, article_id):
    text = '图书详情id：%s' % article_id
    return HttpResponse(text)